利用Pelican和Github Page搭建我们的小博客

注:博客的搭建使用需要借助一些工具,这些工具包括Pelican和git还有markdown等,其中最基础的为python。

前言: 做此博客是为了和各个大牛同步学习,并且记录自身的一些经历,并且这是一个自己做起来的东东,看着它慢慢的充实,也会有不一样的感觉~~~~~~~

介绍: Pelican:可以理解为笔记本,静态网站的生成器,是python写的一个模块(python确实挺强大!) git:版本管理工具,可多人协作~~~~ 你们都懂! python:简洁明了的编程语言~~~~

搭建过程: 1.安装所需工具,此步略过~~~ 2.通过pelican-quickstart建立我们第一个博客的框架,所有问题都可以默认,毕竟后面会生成文件可以供我们后期修改。 注: /Library/Python/2.7/site-packages/pelican/utils.py /Library/Python/2.7/site-packages/pelican/readers.py 这两个文件引用的HTMLParser有问题 #from six.moves.html_parser import HTMLParser from HTMLParser import HTMLParser 3.在conten内生成*.md文件,格式如下

Title: My super title
Date: 2017-02-02 10:20
Category: Python
Tags: pelican, publishing
Slug: test
Author: Gao Yang
Summary: Short version for index and feeds

This is the content of my super blog post.
4.将文件转为静态的页面
1pelican content -o output -s pelicanconf.py
2make html
两种方法都可以,具体的可以看makefile文件。
5.将生成的页面托管到githup pages
1)创建自己的githup账号
2)创建git项目
注:
    (1)你的git项目名必须为.github.io后缀
    (2)你的git项目名必须和你的github账户名保持一致
6.将你创建好的框架上传到github上。切换到output目录
git init
git add .
git commit -m "test"
git remote add origin https://github.com/obeyconquer/obeyconquer.github.io.git
git push -u origin master
7.访问我的博客https://obeyconquer.github.io
About
高洋,IT从业人员, 1989年4月10日, 邮箱:gy59821@163.com, 现就职于北京玩蟹科技有限公司.